<template>
  <h2>父级组件</h2>
  <button @click="isShow =! isShow">显示和隐藏</button>
  <hr/>
  <Child v-if="isShow" />
</template>

<script lang="ts">
import {defineComponent, ref} from "vue";
import Child from "@/views/15_lifecycle/Child.vue";

export default defineComponent({
  name: "LifeCyclle",
  components: {Child},
  setup(){
    const isShow = ref(true)
    return {
      isShow,
    }
  }
})
</script>

<style scoped>

</style>
